//*******************************************************************************
//  PP3_5.java    Author:Tang Caiming
//
//  Write a program, enter the coordinates of two points (x, y), and then
//  use the formula to calculate the distance between two points.
//*******************************************************************************

import java.util.Scanner;

public class PP3_5
{
   public static void main(String[] args)
   {
      Scanner scan = new Scanner(System.in);

      double x1,x2,y1,y2,x,y,distance;

      System.out.println("Enter the X-axis of the first point: ");
      x1 = scan.nextDouble();

      System.out.println("Enter the X-axis of the second point: ");
      x2 = scan.nextDouble();

      System.out.println("Enter the Y-axis of the first point:: ");
      y1 = scan.nextDouble();

      System.out.println("Enter the Y-axis of the second point: ");  
      y2 = scan.nextDouble();

      x = (x2-x1);
      y = (y2-y1);
      
      x = Math.pow(x,2);
      y = Math.pow(y,2);
      
      distance = Math.sqrt(x+y);

      System.out.println("distance:" + distance);
   }
}
